unit SUCharacter;

interface
  uses
    SUParty, SUAccount, SUVirtualTarget, SUTrade, SUTarget;

  Type
    PCharacter = class
      private
        class var _Instance : PCharacter;
        function SinGetParty: PParty;

        constructor Create;
        function SinGetAccount: PAccount;
        function SinGetActiveAbility: String;
        function SinGetVTarget: PVirtualTarget;
        function SinGetTradeHandler: PTradeHandler;
    function SinGetTarget: PTarget;
      public
        class function GetInstance():PCharacter;

        procedure ActivatePrimaryAbility;
        procedure ActivateSecondaryAbility;

        property Party          : PParty          read SinGetParty;
        property Account        : PAccount        read SinGetAccount;
        property ActiveAbility  : String          read SinGetActiveAbility;
        property VirtualTarget  : PVirtualTarget  read SinGetVTarget;
        property TradeWindow    : PTradeHandler   read SinGetTradeHandler;
        property Target         : PTarget         read SinGetTarget;

    end;

implementation
  uses
    SUStealth;

{ UPlayer }

procedure PCharacter.ActivatePrimaryAbility;
begin
  Script.UsePrimaryAbility;
end;

procedure PCharacter.ActivateSecondaryAbility;
begin
  Script.UseSecondaryAbility;
end;

constructor PCharacter.Create;
begin
  // Do not Use!!
end;

class function PCharacter.GetInstance: PCharacter;
begin
  if not Assigned(_Instance) then _Instance := PCharacter.Create;
  Result := _Instance;
end;

function PCharacter.SinGetAccount: PAccount;
begin
  Result := PAccount.GetInstance();
end;

function PCharacter.SinGetActiveAbility: String;
begin
  Result := Script.GetActiveAbility;
end;

function PCharacter.SinGetParty: PParty;
begin
  Result := PParty.GetInstance();
end;

function PCharacter.SinGetTarget: PTarget;
begin
  Result := PTarget.GetInstance();
end;

function PCharacter.SinGetTradeHandler: PTradeHandler;
begin
  Result := PTradeHandler.GetInstance();
end;

function PCharacter.SinGetVTarget: PVirtualTarget;
begin
  Result := PVirtualTarget.GetInstance();
end;

end.
